if(!gData){
	var gData = {};
}
if(!gIdMap){
	var gIdMap = {};
}

String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g, "");
};
// String.format("I'm a {0}", "arg") result in "I'm a arg";
String.format = function(str) {
    if(typeof(str)!="string")return "";
    if (arguments.length <= 1)
        return str;
    var lastIndex = arguments.length - 2;
    for (var i = 0; i <= lastIndex; i++)
        str = str.replace(new RegExp("\\{" + i + "\\}", "gi"), arguments[i + 1]);
    return str;
};

if (!Util) {
	var Util = {};
}

Util.IdProducer = {
	val : 0,
	getId : function() {
		this.val++;
		return this.val;
	}
};

Util.StringBuffer = function(str) {
	var arr = [];
	var s = str || "";
	arr.push(s);
	this.append = function(str1) {
		arr.push(str1);
		return this;
	};
	this.toString = function() {
		return arr.join("");
	};
};